Picture signal coding apparatus

ABSTRACT

A frame of a gray-scaled picture is divided into blocks, in each of which the mean luminance of picture elements is used as a threshold value for comparison with each picture element signal to classify it into 0 or 1 according to its magnitude to provide a resolution component. From the resolution component and each picture element signal in the block are calculated two gray components; the resolution component and the two gray components are used as coded outputs for each block. The size of each block is changed in accordance with the property of the picture in the portion corresponding to the block.

BACKGROUND OF THE INVENTION

This invention relates to a picture signal coding apparatus which is of particular utility when employed in the coding of still pictures.

For the reduction of the cost of picture signal transmission, there have heretofore been proposed DPCM, ΔM and like coding systems, for example, in A. Habihi and G. S. Robinson "A Survey of Digital Picture Coding" Computer, 7,5, pp. 22-34 (May 1974). These known systems are called prediction coding systems, in which a prediction signal is produced based on a sample preceding a reference point and a prediction error signal which is a difference between a sample to be coded and the prediction signal is quantized for transmission. Due to the property of the picture signal, the prediction error signal occurs frequently in the range in which its amplitude is small, so that even if the prediction error signal is quantized roughly, the picture quality is not so much deteriorated; therefore the number of bits necessary for coding can be reduced as compared with that in ordinary PCM in which a sample is coded as it is.

With these conventional prediction coding systems, however, the prediction error signal must be transmitted every sample point, and the number of prediction error signal quantizing levels cannot be reduced extremely because of contributing factors to deterioration of the picture quality such as slope over load, granular noise, false contour, etc. For these reasons, the number of bits used is relatively large as a whole.

As a result of novelty search conducted by the European Patent Office, there was not found any particular prior literature corresponding to this invention but U.S. Pat. Nos. 3,403,226, 3,940,555 and 3,984,626 were cited as reference literatures. Now, a description will be given of U.S. Pat. No. 3,403,226 of the type in which a picture frame is divided into blocks. In this patent, one of picture elements is selected as a typical picture element for each block and coded by the PCM technique so that it can represent, by itself, its level, and the difference between the typical picture element and each of the other picture elements of the same block is coded into a PCM code.

Accordingly, though the number of quantizing levels for the latter PCM code is smaller than that for the typical picture element, transmission of the PCM codes requires a plurality of bits, resulting in an appreciably large number of bits being needed as a whole.

Some of the present inventors have proposed a picture signal coding apparatus of the type in which a frame of a gray-scaled picture is divided into a plurality of blocks; for each of the blocks, a threshold value is determined based on the luminance distribution in the block; each picture element signal of the block is compared with the threshold value to obtain a resolution component 1 or 0 according to the magnitude of the picture element; based on the resolution component and the picture element signals of the block, two typical luminance levels, that is, gray components, are determined; and the gray components and the resolution component are provided as coded outputs for the block. With such a method, two typical luminance levels are provided for each block and a 1-bit resolution component for each picture element; therefore the number of bits used in small as a whole and the picture can be reconstructed with excellent minuteness and tone wedge property. In this case, however, coding errors differ with blocks due to the property of the picture whose changes differ throughout its entire area of the frame. In other words, the coding errors are not distributed uniformly all over the reconstructed picture. Further, there is the possibility that the coding errors are centered on the areas near the borders of the blocks to make contours of the blocks noticeable in the reconstructed picture.

An object of this invention is to provide a picture signal coding apparatus which enables coding with less bits than those used in the prior art.

Another object of this invention is to provide a picture signal coding apparatus in which a picture frame is divided into blocks and then coded but the contour of each block is not noticeable in the reconstructed picture.

Still another object of this invention is to provide a picture signal coding apparatus in which a picture frame is divided into blocks but their sizes are each changed in accordance with the local property of the frame, thereby to enable coding with less bits.

SUMMARY OF THE INVENTION

According to this invention, a frame of a gray-scaled picture is divided into a plurality of blocks, and based on the statistical property of the luminance levels of picture elements in each block, the picture elements of the block are separated into gray components and resolution components, thereafter being coded. For instance, a threshold value is set in each block based on the luminance distribution therein, and the luminance level of each picture element is checked whether it is higher or lower than the threshold value. From the check results and the luminance levels of the picture elements are obtained two typical luminance levels. For each block, the two typical luminance levels and the check results are transmitted in the form of codes. Letting a₀ and a₁ represent the typical luminance levels, x_(t) represent the threshold value, x_(i) represent the luminance level of each picture element and y_(i) represent the luminance level of the picture element after being converted by coding, decoding is achieved by the following conversion:

    y.sub.i =φ.sub.i ·a.sub.0 +φ.sub.i ·a.sub.1

where when x_(i) ≧x_(t), φ_(i) =1, where when x₁ <x_(t), φ_(i) =0, and where φ_(i) is the complement of φ_(i). The typical luminance levels a₀ and a₁ are gray components, and φ₁ is a resolution component.

The typical luminance levels a₀ and a₁ and the threshold value x_(t) are determined, for example, in the following manner.

In accordance with a first method, a condition x=y that means luminance levels x and y of the picture elements in each block remain unchanged before and after coding, is given, and the mean luminance level of the picture elements in each block before coding is used as the threshold value x_(t), namely x_(t) =x, and the following mean square errors before and after conversion in each block ##EQU1## are minimized, whereby to obtain the typical luminance levels a₀ and a₁ and the threshold value x_(t). That is, letting x_(i) represent the luminance level of each picture element in each block, N₀ represent the number of picture elements in the block, x represent the mean luminance level of the picture elements in the block, x_(L) represent the mean luminance level of the group of those picture elements whose luminance levels are lower than the mean luminance level x, N₁ represent the number of such picture elements, x_(H) represent the mean luminance level of the group of those picture elements whose luminance levels are higher than the mean luminance level x and N₂ represent the number of such picture elements, the mean luminance levels x, x_(L) and x_(H) are given as follows: ##EQU2## obtaining the condition that the mean square error powers ε² for the typical luminance levels a₀ and a₁ are minimized, namely, (∂/∂a₀)ε² =0 and (∂/∂a₁)ε² =0, the typical luminance levels a₀ and a₁ are given as follows:

    a.sub.0 =x.sub.L

    a.sub.1 =x.sub.H

This method is referred to as the two average value method.

A second method is to obtain the typical luminance levels a₀ and a₁ and the threshold value x_(t) from the abovesaid condition x=y, a condition x² =y² that luminance powers x² and y² of the picture elements in the blocks before and after conversion remain unchanged before and after coding, and a condition (∂/∂x_(t))ε² =0 that the mean error power becomes minimized in respect of the threshold value x_(t). That is, letting x_(L).spsb.' represent the mean luminance level of the group of those picture elements whose luminance levels are lower than the threshold value, N₁ represent the number of such picture elements, x_(H).spsb.' represent the mean luminance level of the group of those picture elements whose luminance levels are higher than the threshold value, N₂ represent the number of such picture elements, x represent the mean luminance level of picture elements in each block before coding and δ² represent variance of luminance levels of the picture elements, the mean luminance levels x_(L).spsb.', x_(H).spsb.' and variance δ² are given a follows: ##EQU3## The threshold value x_(t) is given as follows:

    x.sub.t =1/2(x.sub.L.spsb.' +x.sub.H.spsb.')

The typical luminance levels a₀ and a₁ are given as follows:

    a.sub.0 =x-√N.sub.2 /N.sub.1 δ, a.sub.1 =x+√N.sub.1 /N.sub.2 δ

This method is referred to as the variance method.

In the case of this method, if it were supposed that x_(t) =x so as to simplify the process of obtaining the threshold value x_(t), the mean square error ε² is not always minimized, but the typical luminance levels a₀ and a₁ are the same as those obtainable in the above.

A third method is to simultaneously satisfy the conditions x=y, (∂/∂a₀)ε² =0, ∂/∂a₁ ε² =0 and (∂/∂x_(t))ε² =0 utilized in the first and second methods. In this instance, the threshold value x_(t) is expressed as follows:

    x.sub.t =1/2(x.sub.i +x.sub.H')

and the typical luminance levels a₀ and a₁ are as follows: ##EQU4## This method is referred to as the variable threshold method.

Thus, in this invention, there are transmitted the typical luminance levels a₀ and a₁ in each block and the resolution component indicative of the level a₀ or a₁ at which each picture element is to be decoded. In other words, for each picture element, information "1" or "0" is transmitted, and for each block, the typical luminance levels a₀ and a₁ of the block are transmitted. Accordingly, the number of bits used is markedly reduced as a whole, and in addition, since the picture frame is divided into blocks, excellent picture reconstruction can be achieved.

In this invention, the picture frame is divided into blocks, so the boundary of each block is likely to be noticeable. To avoid this, the luminance of the picture element on the outside of the block near the boundary thereof is taken into account in the determination of the threshold value x_(t) near the boundary. Alternatively, the threshold value for determining whether the luminance of the picture elements near the boundary of the block are above or below is modified in accordance with the threshold value of the adjoining block.

For example, in the case where a luminance change is small in a particular portion of the picture, deterioration of the picture quality is relatively small even in a relatively large block; in such an instance, if the block is made large, the number of typical luminance levels is decreased by that and the number of bits can be reduced correspondingly. In such a portion where the picture greatly changes, even if the block is relatively small, the reconstructed picture quality is markedly degraded. Accordingly, it is preferred to change the size of each block in accordance with the property of the picture. For example, a code conversion is carried out for a block of a predetermined size, and the absolute values of the differences between the luminance levels of the picture elements before and after the conversion, ε_(i) =|y_(i) -x_(i) |, are added together for each block, and depending upon whether the sum is too small or large, the block is made large or small. It is also possible to add together the square values of the absolute value ε_(i) for each block and control the size of the block in accordance with the added value. Also, it is possible to make the block small or large in dependence upon whether the difference, D=a₁ -a₀, between the gray components a₀ and a₁ is large or small.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an embodiment of the picture signal coding apparatus according to this invention;

FIG. 2 is a diagram showing an example of a picture divided into blocks;

FIG. 3 is a block diagram illustrating an example of a coding apparatus 14 utilized in FIG. 1;

FIG. 4 is a block diagram showing an example of a threshold calculator 17 used in FIG. 3;

FIG. 5 is a block diagram showing an example of an a₀ calculator 19 utilized in FIG. 3;

FIG. 6 is a block diagram illustrating an example of a decoding apparatus for decoding a coded signal from the coding apparatus of this invention;

FIG. 7 is a block diagram showing an example of a decoder 42 used in FIG. 6;

FIG. 8 is a block diagram showing another embodiment of coding apparatus of this invention which employs a microprocessor;

FIG. 9 is a flowchart showing the basic operations for coding;

FIG. 10 is a flowchart showing a coded block read-in routine;

FIG. 11 is a flowchart showing a threshold value calculating routine;

FIG. 12 is a flowchart showing a resolution component discriminating routine and a typical luminance level calculating routine;

FIG. 13 is a flowchart showing the basic operations for decoding;

FIGS. 14A through 14C are diagrams showing the relationships between coded blocks and a reference block;

FIG. 15 is a flowchart showing a reference block read-in routine;

FIGS. 16A through 16C are diagrams showing the relationships of a picture element on the block boundary and a modified threshold value to a corrected typical luminance level;

FIG. 17 is a flowchart showing a threshold modifying routine;

FIG. 18 is a block showing the relationship between first and second blocks;

FIG. 19 is a block diagram showing a first block read-in routine;

FIG. 20 is a block diagram illustrating an example of the case of controlling the size of a block in the apparatus of this invention;

FIG. 21 is a block diagram showing an example of the coding apparatus of FIG. 20;

FIG. 22 is a block diagram showing an example of a block control circuit 71 used in FIG. 20;

FIGS. 23A through 23C are diagrams showing the relationships among large, medium and small blocks;

FIG. 24 is a flowchart showing a coding operation in the case of controlling the block size; and

FIG. 25 is a flowchart showing a decoding operation in the case of controlling the block size.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Referring now to FIG. 1, a picture signal picked up by a TV camera 11 is quantized by an analog-to-digital converter 12 for each picture element, thereafter being stored in a video memory 13. The picture picked up by the TV camera 11 is divided into, for instance, N×M blocks, as depicted in FIG. 2, and each block is composed of n×m picture elements. The picture signal stored in the video memory 13 is read in a coding apparatus 14 for each block.

Letting x_(i) represent the luminance level of each picture element in the block, the luminance level x_(i) is converted by the coding apparatus 14 to y_(i) in the following process:

    y.sub.i =φ.sub.i ·a.sub.1 +φ.sub.1 ·a.sub.0

where when x_(i) ≧x_(t), φ_(i) =1 and φ_(i) =0 and when x_(i) <x_(t), φ_(i) =0 and φ_(i) =1. The values x_(t), a₀ and a₁ are obtained from the distribution of luminance levels of the picture elements in the block by one of the three methods described previously. By the coding apparatus 14, picture information in the block is converted to gray components a₀ and a₁ and resolution components (φ₀, φ₁, . . . φ_(q)) (q=m×n). These converted codes are stored in a buffer memory 15, from which they are read out thereof at a constant speed suitable to a transmission line and provided thereon via a modem 16.

The coding apparatus 14 is constructed, for example, as illustrated in FIG. 3. The output from the video memory 13 is applied to a threshold value calculator 17, one input terminal of a comparator 18, an a₀ calculator 19 and an a₁ calculator 21, respectively. In the threshold value calculator 17, for example, as shown in FIG. 4, the picture element signals applied via a terminal 22 from the video memory 13 are sequentially accumulated in an adder 23, the initial value of which is reset at zero. Upon completion of addition of all the picture elements of the block, the output from the adder 23 is provided to a dividend input terminal of a divider 24, in which the input thereto is divided by a divisor stored in a divisor register 25. The value of the divisor is the number of all picture elements of the block m×n, and is set by a signal at a terminal 25. In this manner, the mean luminance level value x of the picture elements in the block is derived as the threshold value x_(t) at a terminal 27.

The threshold value x_(t) thus obtained is applied to the other input terminal of the comparator 18 in FIG. 3. The comparator 18 compares the luminance level x_(i) of each picture element with the threshold value x_(t) to provide the resolution component (φ_(i)) to the buffer memory 15. The compared output φ_(i) and its inverted output φ_(i) from an inverter 28 are applied to the a₁ calculator 21 and the a₀ calculator 19, respectively, to obtain the gray components a₀ and a₁.

In the a₀ calculator 19, for example, as depicted in FIG. 5, the picture element signals x_(i) from the video memory 13 are supplied via a terminal 31 to a gate 29. The resolution component φ_(i) from the inverter 28 is also applied as a control signal to the gate 29 via a terminal 32. The gate 29 is opened or closed depending upon whether the resolution component φ_(i) is 1 or 0. Accordingly, in the case where x_(i) <x_(t), namely, φ_(i) =1, the picture element signals are accumulated in an adder 33 via the gate 29. Thus, all picture elements in the block that x_(i) <x_(t) are added together in the adder 33.

The number of the gate control signals φ_(i) at the terminal 32 in this case is counted by a divisor counter 34 to obtain the number N₁ of the picture elements that x_(i) <x_(t) for each block. The divider 35 divides the added result ##EQU5## of the adder 33 by the picture element number N₁ stored in the divisor counter 34, providing the gray component a₀ at a terminal 36. The a₁ calculator 21 in FIG. 3 is identical in construction with the a₀ calculator 19 and produces the gray component a₁ at a terminal 37. The gray components a₀ and a₁ thus obtained are stored in the buffer memory 15 at suitable timings.

The picture signal coded, as described above, is decoded in the following manner. For instance, as shown in FIG. 6, the coded picture signal applied via a terminal 38 from the transmission line is received and demodulated by a modem 39. The demodulated signal is once stored in a buffer memory 41 and then supplied to a decoder 42, in which each picture element signal is decoded, thereafter being written in a frame memory 43. The content of the frame memory 43 is read out thereof and converted by a digital-to-analog converter 44 to an analog signal, which is reconstructed by a video monitor 45 into a picture.

The decoder 42 is constructed, as shown in FIG. 7. A demultiplexer 46' is controlled by a control signal from a terminal 47' to separate the signal from the buffer memory 41 into the gray components a₀ and a₁ and the resolution component φ₁. The components a₀, a₁ and φ_(i) are transferred to buffer registers 48', 49' and 51, respectively. By the information φ_(i) from the buffer register 51, gates 52 and 53 are controlled to open or closed to permit the passage therethrough of either one of the information a₀ and a₁ stored in the buffer registers 48' and 49', providing at a terminal 54 the information as each picture element signal in the block. That is, when φ_(i) =0, i.e. x_(i) <x_(t) on the transmitting side, the gate 52 is opened by the inverted output φ_(i) from an inverter 55 to pass on the information a₀ in the buffer register 48' to the terminal 54, whereas when φ_(i) =1 and x_(i) ≧x_(t) on the transmitting side, the gate 53 is opened by the information φ_(i) to pass on the information a₁ in the buffer register 49' to the terminal 54. Though not shown, since the position of each picture element in each block is known, the output at the terminal 54 is written in the frame memory 43 at an address corresponding to the abovesaid position. When the picture element signals of all blocks have thus been decoded and decoded information of one frame has been stored in the frame memory 43, a still picture of one frame is reconstructed on the video monitor 45.

The coding and decoding described above can also be achieved by a stored program, using the so-called microcomputer. For example, as illustrated in FIG. 8, The output from the TV camera 11 is supplied to the analog-to-digital converter 12 for conversion into a digital signal, the output side of the analog-to-digital converter 12 being connected to a system bus 46. To the system bus 46 are also connected the video memory 13 and the digital-to-analog converter 44. Further, a central processing unit (CPU) 47, a read only memory (ROM) 48 and a random access memory (RAM) 49 are respectively connected to the system bus 46. The output side of the digital-to-analog converter 44 is connected to the video monitor 45.

The read only memory 48 stores therein a program for coding and decoding, and the central processing unit 47 sequentially reads out the program from the read only memory 48 and interprets and execute it, thereby to effect coding and decoding. The video memory 13 stores therein the output from the TV camera 11 in digital form or the decoded picture signal, and the stored content of the video memory 13 is read out thereof and converted by the digital-to-analog converter 44 to an analog signal for input to the video monitor 45. The random access memory 49 is utilized for temporarily storing data necessary for coding and decoding.

A basic flowchart for coding is illustrated in FIG. 9. Upon starting, the content N of a row block memory is made 1 in a step S₁, and then the content M of a column block memory is made 1 in a step S₂. In a step S₃, picture element signals of the block designated by the contents N=1 and M=1 of the block memories are read in a temporary storage. Based on these picture element signals, the threshold value x_(t) is calculated in a step S₄. In a step S₅, the threshold value x_(t) is stored in a threshold memory corresponding to each picture element in the block. Next, in a step S₆, a resolution component φ_(IJ) is discriminated from each picture element signal x_(IJ) and the threshold value x_(t) corresponding thereto, and the gray components, that is, the typical luminance levels a₀ and a₁ are calculated. Each block is composed of picture elements of n rows and m columns, I=1, 2, . . . m and J=1, 2, 3, . . . n.

In a step S₇, the components a₀, a₁ and φ_(IJ) are transmitted, and then in a step S₈, the content M of the column block memory is added with 1. In the next step S₉, it is checked whether the memory content M has reached its maximum value Mm or not, and in the case where the content M is larger than the maximum value Mm, the content M of the row block memory is added with 1 in a step S₁₀. In a step S₁₁, it is checked whether the content N is in excess of its maximum value Nm, and if the content N is smaller than or equal to the maximum value Nm, the operation goes back to the step S₂. Where the content M of the column block memory is smaller than or equal to the maximum value Mn in the step S₉, the operation goes to the step S₃. When the content N is in excess of the maximum value Nm in the step S₁₁, it means completion of coding of the entire frame, and the operation is stopped.

A coded block read-in routine in the step S₃ is shown, for example, in FIG. 10. At first, in a step S₁₂ the content M of the column block memory is set to M of block numbers M and N to be read in, and the content N of the row block memory is made N. The content J of a block row address memory which indicates that addresses J and I in the block is made 1 in a step S₁₃, and in a step S₁₄, the content I of a block column address memory is made 1. Next, in a step S₁₅, a calculation I+(M-1)xm of a frame row address i and a calculation J+(N-1)xn of a frame column address j are carried out. The luminance level x_(ij) of picture element at the address (ij) is read out from the video memory 13 in a step S₁₆ and then transferred to the random access memory 49. Next, in a step S₁₇ the content I of the block column address memory is added with 1, and it is checked in a step S₁₈ whether the content I is smaller than, equal to or larger than m. Where i≦m, the operation goes back to the step S₁₅, in which the luminance of the next picture element is read out and transferred. When I>m in a step S₁₈, the content J of the block row address memory is added with 1 in a step S₁₉, and the result of the addition is checked in a step S₂₀. Where J≦n, the operation goes back to the step S₁₄, whereas when J>n the block read-in operation is completed. In this manner, the addresses of the picture elements in each block on the frame are sequentially designated, and the picture element signals are read in a temporary storage.

A threshold value x_(t) calculation routine in the step S₄ in FIG. 9 is illustrated in FIG. 11. This routine starts with making the content SUM of a summing memory zero in a step S₂₁. In the next step S₂₂, the content J of the block column address memory is made 1, and in a step S₂₃, the content I of the block row address memory is made 1. In a step S₂₄, the picture element signal x_(IJ) designated by the contents I and J of the address memories is added to the content SUM of the summing memory and the added result is stored therein. Thereafter, in a step S₂₅, the content I of the block column address memory is added with 1 and the added result is checked in a step S₂₆. In the case of I≦m, the operation goes back to the step S₂₄, in which luminance levels of the picture elements in the block are accumulated one after another. In the case of I>m, the operation proceeds to a step S₂₇, in which the content J of the block row address memory is added with 1, and the result of addition is checked in a step S₂₈. Where J≦n, the operation goes back to the step S₂₃, whereas where J>n the operation proceeds to a step S₂₉, in which the accumulated value SUM in the summing memory is divided by the number of picture elements in the block, m×n, to obtain the threshold value x_(t), which is stored in the threshold value memory.

In FIG. 12 is shown the calculation routine of the components φ_(IJ), a₀ and a₁ n the step S₆ in FIG. 9. At first, in a step S₃₀ contents S₁ and S₂ of first and second summing memories and contents N₁ and N₂ of first and second counter memories are respectively made zero. Then, in a step S₃₁ the content J of the block row address memory is made 1, and in a step S₃₂ the content I of the block column address memory is made 1. In a step S₃₃ the luminance x_(IJ) of the picture element designated by the contents I and J of these address memories and the threshold value x_(t) are compared with each other. In the case of x_(IJ) <x_(t), the operation proceeds to a step S₃₄, in which the content φ_(IJ) of a resolution memory at the corresponding address is made 0, and in a step S₃₅ the content N₁ of the first counter memory is added with 1 and the picture element signal x_(IJ) is accumulated to the content S₁ of the first summing memory. Where x_(IJ) ≦x_(t) in the step S₃₃, the operation goes to a step S₃₇, in which the content φ_(IJ) of the resolution memory at the corresponding address is made 1, and in a step S₃₈ the content N₂ of the second counter memory is added with 1 and the content S₂ of the second summing memory is accumulatively added with x_(IJ). The step S₃₆ or S₃₉ is followed by a step S₄₀, in which the content I of the block column address memory is added with 1, and the result of addition is checked in a step S₄₁. In the case of I≦m, the operation goes back to the step S₃₃, in which the next picture element signal is compared with the threshold value. In the case of I>m, the operation goes to a step S₄₂, in which the content J of the block row address memory is added with 1. The result of addition is checked in a step S₄₃, and if J≦n, the operation returns to the step S₃₂, and if J>n, the content S₂ of the second summing memory is divided by the content N₂ of the second counter memory to obtain the typical luminance level a₁ in a step S₄₄. Next, in a step S₄₅ the content N₁ of the first counter memory is checked, and when the content N₁ is not zero, the content S₁ of the first summing memory is divided by the content N₁ of the first counter memory to obtain the typical luminance level a₀ in a step S₄₆. If N₁ =0 in the step S₄₅, the typical luminance level a₀ is made equal to a₁.

Turning next to FIG. 13, the decoding operation will be described. Let it be assumed that the video memory 13 in FIG. 8 has stored therein the components a₀, a₁ and φ_(IJ) of one frame. At first, in a step S₄₈ the content N of the row block memory is made 1, and in a step S₄₉ the content M of the column block memory is made 1. Then, based on the contents M and N of these block memories, the components a₀, a₁ and φ_(IJ) of each picture element in the block are read in the random access memory 49 in a step S₅₀. Next, in a step S₅₁ the components a₀ and a₁ are written as an output y_(IJ) in the video memory 13 at the corresponding address depending upon whether the component φ_(IJ) is 0 or 1. In the next step S₅₂, the content M of the column block memory is added with 1 and its result is checked in a step S₅₃. Where M≦Mn, the operation goes back to the step S₅₀, in which a code of the next block is read in a temporary storage. Where M>Mn, the content N of the row block memory is added with 1 in a step S₅₄. Then, the content N is checked, and if N≦Nm, the operation goes back to the step S₄₉, and if N>Nm, it means completion of decoding of all picture elements and the decoding operation is stopped.

The decoding operation may also be achieved in the following manner: At first, a picture element address (ij) on the frame is determined, the components a₀, a₁ and φ_(ij) of the block to which the address (ij) belong are read out of the video memory 15, decoding of y_(ij) =φ_(ij) a₀ +φ_(ij) a₁ is effected and the decoded output y_(ij) is written in the video memory 15 at the address (ij); such a decoded output is similarly obtained in connection with each of the other addresses.

With the coding apparatus described above, it is possible to obtain a reconstructed picture with a small number of bits and excellent resolution. Especially, the threshold value x_(t) and the typical luminance levels a₀ and a₁ are so set as to minimize the code conversion error between the picture elements in each block, so that a reconstructed picture can be obtained which is very excellent as compared with the portion of the original picture corresponding to the block. In some cases, however, there is the possibility that conversion errors are centered on the borders of blocks, allowing their contours to appear in the reconstructed picture.

The borders of the blocks can be made unnoticed in the reconstructed picture by the following method. That is, consider a block whose picture elements are to be coded (which block will hereinafter be referred to as the coding block) and a reference block which includes the coded block and is larger than it; for example, a coding block 51 having 8×8 picture elements and a reference block 52 which is larger than the coding block 51 by two picture elements on all four sides and is therefore composed of 12×12 picture elements, as shown in FIG. 14A. The reference block 52 may be such as shown in FIG. 14B in which it is larger than the coding block 52 on its two adjacent sides by two picture elements and hence is composed of 10×10 picture elements. Further, the reference block 52 may also be such as shown in FIG. 14C in which it is larger than the coding block 52 on its one side by two picture elements and hence is composed of 8×10 picture elements.

In the coding of the picture elements of the coding block, the mean luminance level of the reference block 52 is used as the threshold value x_(t). And for the coding block 51, the resolution component φ_(i) and the typical luminance levels a₀ and a₁ are obtained in the same manner as described previously.

In the case of coding the picture elements of the coding block 51 by a stored program, the reference block 52 is read in a temporary storage by the routine depicted in FIG. 15. In this example, the reference block 52 bears the relationship shown in FIG. 14A to the coding block 51, and has a size of rxr, where r=n+2. In a step S₅₆, the contents M and N of the column and row block memories are respectively read out thereof, and in a step S₅₇ the content J of the block row address memory is made 1, and then in a step S₅₈ the content I of the blow column address is made 1. In a step S₅₉ calculations, I+(M-1)×m-1 and J+(N-1)+n-1, of the row address j and the column address i are achieved. In a step S₆₀ the luminance x_(ij) of the picture element in the frame address ij is read out of the video memory 13. In a step S₆₁ the content I of the block column address memory is added with 1, and the added result is checked in a step S₆₂. Where I≦r, the operationn goes back to the step S₅₉, in which the next address is calculated. Where I>r, the operation proceeds to a step S₆₃, in which the content J of the block row address memory is added with 1. The result of this addition is checked in a step S₆₄, and if J≦r, the operation goes back to the step S₅₈, whereas if J>r, then the coding operation is stopped. In this way, the luminance of each picture element in the reference block for the coding block, assigned by the contents N and M of the row and column block memories, is read in the temporary storage, and the threshold value x_(t) is calculated by the same method as that shown in FIG. 11. By using the threshold value x_(t) thus obtained, the components φ_(IJ) and a₀ and a₁ are calculated for the coding block in the manner shown in FIG. 12. By using the threshold value of the reference block as described above, it is possible to prevent the coding errors from being centered on the border of the coding block.

Regarding picture elements of a block adjoining the coding block, a threshold value change between the both blocks can be modified by reference to the threshold value of the adjoining block so that the change may be gradual in the picture frame. For example, in the case where the threshold value of a coding block (M,N) composed of 8×8 picture elements is x_(t) (M,N) and the threshold value of a coding block (M+1,N) adjacent the block (M,N) is x_(t) (M+1,N), as shown in FIG. 16A, the threshold value of a picture element column 54 of the block (M,N) third from a border line 53 between the blocks is made x_(t) (M,N), the threshold value of a picture element column 55 of the block (M+1,N) third from the border line 53 is made x_(t) (M+1,N), these threshold values are joined together by a straight line 56 and values x_(t1) and x_(t2) on the line 56 at those positions corresponding to picture element columns 57 and 58 of the block (M,N) second and first from the border line 53 are used as threshold values of these picture element columns, as illustrated in FIG. 16B. In a similar manner, the threshold values for picture elements of picture element columns 59 and 60 of the block (M+1,N) first and second from the border line 53 are made x_(t3) and x_(t4), respectively. The typical luminance levels are a_(0') and a_(1') in the block (M+1,N).

A routine for such threshold value modification is shown in FIG. 17. In a step S₆₅ the contents of the column and row block memories are set to M and N, respectively, in accordance with the coding block (M,N). In a step S₆₆ the content J of the block row address memory is made 1, and in a step S₆₇ the content I of the block column address memory is made 1. In a step S₆₈ the contents of these block address memories are checked, and in the case of 1≧I≦6 and 1≦J≦2, that is, in the case of the picture element to be coded lying in a region 61 in FIG. 16A, the operation proceeds to a step S₆₉, and in the other cases, the operation goes to a step S₇₀. In the step S₆₉ the content J of the block row address memory, the threshold value x_(t)(M,N) of the block (M,N) and the threshold value x_(t)(M,N-1) of the adjoining block (M,N-1) are respectively stored in an address register P, a threshold value register T₀ and a threshold value register T₀ '. In the step S₇₀ it is checked whether 7≦I≦8 and 1≦J≦6 or not, that is, whether the picture element to be coded is in a region 62 or not, and in the case of the picture element lying in the region 62, the operation proceeds to a step S₇₁, in which the memory content 9-I, the threshold value x_(t)(M,N) and the threshold value x_(t)(M+1,N) of the adjoining block (M+1,N) are respectively stored in the address register P, the threshold value register T₀ and the threshold value register T₀ '. If the picture element to be coded is outside of the region 62 in the step S₇₀, the operation goes to a step S₇₂, in which it is checked whether 3≦I≦8 and 7≦J≦8 or not, that is, whether or not the picture element to be coded lies in a region 63 in FIG. 16A. In the event that the picture element lies in the region 63, 9-J is stored in the address register and the threshold values x_(t)(M,N) of the block (M,N) and x_(t)(M,N+1) of the adjoining block (M,N+1) are respectively stored in the threshold value registers T₀ and T₀ '. In a step S₇₃, if it is detected that the picture element to be coded is outside of the region 63, the operation proceeds to a step S₇₄, in which it is checked whether 1≦I≦2 and 3≦J≦8, that is, whether or not the picture element is present in a region 64 in FIG. 16A, and if so, the content I of the block column address memory is stored in the address register P and the threshold values x_(t)(M,N) and x_(t)(M-1,N) of the blocks (M,N) and (M-1,N) are respectively stored in the threshold value registers T₀ and T₀ '. In the step S₇₄, if it is detected whether the picture element to be coded is not in the region 64, the operation proceeds to a step S₇₆, in which it is checked whether 3≦I≦6 and 3≦J≦6 or not, that is, whether or not the picture element to be coded lies in a non-modification region in the central portion of the block (M,N) in FIG. 16A. If so, then the operation proceeds to a step S₇₇, in which the threshold value x_(t)(M,N) is stored in the threshold value register T₀. If not so, the address IJ is outside of the block (M,N), so that this routine comes to an end.

In a step S₇₈ a threshold value modifying calculation is executed based on the content P of the address register P and the contents x_(t) and x_(t) ' of the threshold value register T₀ and T₀ ' stored in the steps S₆₉, S₇₁, S₇₃ and S₇₅, respectively. This calculation is, for example, as follows: ##EQU6## This modified threshold value or the threshold value which need not be modified in the step S₇₇ is stored in the threshold value memory at an address T_(IJ) corresponding to the address of each picture element in a step S₇₉. Next, in a step S₈₀ the content I of the block column address memory is added with 1, and in a step S₈₁ the content I is checked; if I≦8, the operation goes back to the step S₆₈ to achieve the threshold value correction for the next picture element. If I≦8, the content J of the block row address memory is added with 1, and the content J is checked in a step S₈₃. Where J≦8, the operation goes back to the step S₆₇, and where J≦8, the threshold value correction for each picture element of the block (M,N) is completed.

The coding errors can also be prevented by the following method from being centered on the border of the block. For example, as shown in FIG. 18, the picture frame is divided into first blocks 66, each composed of 8×8 picture elements, as indicated by the full lines, and second blocks 67, each similarly composed of 8×8 picture elements but displaced in the row and column directions by half pitch, as indicated by broken lines. One of adjacent one of the picture elements belongs to the first block 66, and the other belongs to the second block 67. In FIG. 18, those of the picture elements which belong to odd rows and columns and even rows and columns, as indicated by black circles, belong to the first block 66, and the other remaining picture elements indicated by white circles belong to the second block 67. For each first block 66, similar coding is effected to obtain the resolution component φ_(i) and the gray components a₀ and a₁ ; also for each second block 67, the resolution component φ_(i) nd the gray components a₀ and a₁ are similarly obtained.

For such coding, for example, the first blocks 66 are sequentially read in a temporary storage, and the picture elements of each block are coded by the same procedure as described previously, and then the second blocks 67 are successively read in a temporary storage, and the picture elements of each block are coded. A first block read-in routine is shown in FIG. 19 in connection with the example of FIG. 18. In a step S₈₄ the content J of the block row address memory is made 1, and in a step S₈₅ the content I of the block column address memory is made 1. In a step S₈₆ row and column addresses, i=2I-1+(M-1)×4 and j=2J-1+(N-1)×4, on the picture frame are calculated. In a step S₈₇ an address, k=I+J-1, in the buffer memory is calculated, and in a step S₈₈ the picture element x_(ij) of the address ij is read out and written in the address k of the buffer memory. In a step S₈₉ the content I of the block column address memory is added with 1, and in a step s₉₀ the added result is checked. In the case of I≦2, the operation goes back to the step S₈₆, and in the case of I>2, the operation proceeds to a step S₉₁. In a step S₉₁ the content J of the block row address memory is added with 1, and the added result is checked in a step S₉₂. If J≦2, the operation goes back to a step S₈₅, and in the case of J<2, the operation proceeds to a step S₉₃, in which the content J of the block row address memory is made 1, and in a step S₉₄ the content I of the block column address memory is made 1. In a step S₉₅ addresses on the picture frame, i=2I+(M-1)×4 and j=2J+(N-1)×4, are calculated. In a step S₉₆ an address in the buffer memory, k=I+J+3, is calculated. In a step S₉₇ the picture element signal ij is stored in the address k of the buffer memory. In a step S₉₈ the content I of the block column address memory is added with 1, and in a step S₉₉ the added result is checked. Where I≦2, the operation goes back to the step S₉₅, and where I>2, the operation proceeds to a step S₁₀₀, in which the content J of the block row address is added with 1. The result of addition is checked in a step S₁₀₁, and in the case of J≦2, the operation goes back to the step S₉₄, and in the case of J>2, the operation comes to an end.

The routine for reading the second block 67 in a temporary storage is the same as the routine of FIG. 19 except that i=2I-1+(M-1)×4×2 and j=2J+(N-1)×4+2 are calculated in the steps S₈₆ and S₉₅. The first and second blocks 66 and 67 need not always be displaced from each other by just half pitch, as shown in FIG. 18, and as long as they are merely displaced from each other, it is possible to obtain the effect of preventing the coding error from being centered on the border of the block.

The concentration of the coding errors on the border of the block can also be avoided by correcting the typical luminance levels a₀ and a₁ for the picture elements lying near the border of the block during decoding. This modification may be achieved in the same manner as in the case of modification of the threshold value described previously with respect to FIG. 16. That is, in the case where the typical luminance levels a₀ and a₁ of the block (M,N) and the typical luminance levels a₀ ' and a₁ ' of the adjoining block (M+1,N), levels intermediate between the typical luminance levels a₀ and a₀ ' and levels intermediate between the typical luminance levels a₁ and a₁ ', as indicated by black circles in FIG. 16C, are used respectively for the picture elements of the blocks (M,N) and (M+1,N) in the vicinity of the border line 53 therebetween. The calculation for correcting these luminance levels can be achieved in the same procedure as that described previously in respect of the threshold value correcting calculation in FIG. 17.

In the above, the picture frame is divided into blocks of the same size, but even if a portion of the frame where the picture changes slightly over a wide range is made a larger block, the reconstructed picture quality is not degraded. Conversely, if a portion of great picture changes is made a smaller block, the reconstructed picture quality can be enhanced. Accordingly, it is preferred to control the size of each block in accordance with the property of the picture in its particular region. An example of such control will be described with reference to FIG. 20. From the video memory 13, picture elements of one block are read in a coding apparatus 14' and coded in the same manner as described previously in respect of FIG. 3, thereby to obtain the typical luminance levels a₀ and a₁ and the resolution component φ_(i). These components are not immediately sent out but instead decoded by the coding apparatus 14' to provide the decoded signal y_(i). The decoded signal y_(i) is supplied to a block control circuit 71 to obtain the error ε_(i) between the original picture element signal x_(i) and the decoded signal y_(i), and the sum total of the squares ε_(i) ² of the error ε_(i) for all the picture elements of the block is obtained. In the event that the sum total is larger than a preset value, the block is made smaller and its picture element signals are read in the coding apparatus 14' and similarly coded and the coded output is decoded to obtain the error; this operation is repeatedly carried out until the sum total of the squares ε_(i) ² becomes smaller than the preset value. Where the sum total of ε_(i) ² has become smaller than the preset value, the coded output at that moment is provided to the buffer memory 15. The coding apparatus 14' is one that the coding apparatus 14 shown in FIG. 3 has the decoding function, as illustrated in FIG. 21. The resolution component φ_(i) from the comparator 18 and the gray components a₀ and a₁ from the a₀ and a₁ calculators 19 and 21 are respectively stored in registers 72, 73 and 74 under the control of a timing control circuit 75. The outputs a₀ and a₁ from the registers 73 and 74 are respectively provided to gates 76 and 77, which are controlled by the resolution component φ_(i) from the register 72. Where the resolution component φ_(i) is "1", the gate 76 is opened but the gate 77 is controlled via an inverter 78, and when the component φ_(i) is "0", the gate 77 is opened. The outputs from these gates are combined with each other and applied to a terminal 79 to provide there the decoded output y_(i).

In the block control circuit 71, as shown in FIG. 22, the original picture element signal x_(i) and the decoded signal y_(i), which occupy the same position in the block before and after the code conversion, are provided respectively from the video memory 13 and the terminal 79 to a subtractor 81 to obtain therein the difference between them, ε_(i) =y_(i) -x_(i). The difference output ε_(i) is squared by a square-law circuit 82. The squared output ε_(i) ² is applied to an adder 83 for accumulation. When the sum total ε₁ ² of the squares ε_(i) ² for all the picture elements of one block has been obtained, the output from the adder 83 is applied to a comparator 84 for comparison with a preset value T₈ from a setting circuit 85 which is predetermined in the case of the block being composed of 8×8 picture elements. The comparator 84 produces an output D₁ =0 or D₁ =1 in dependence upon whether ε₁ ² <T₈ or ε₁ ² ≧T₈. Where D₁ =0, a coding control circuit 86 provides via a terminal 87 to the timing control circuit 75 of FIG. 21 a command signal for transferring the contents of the registers 72, 73 and 74 of FIG. 21 as coded outputs to the buffer memory 15. Upon receiving the command signal, the timing control circuit 75 actuates a multiplexer 88 to successively transfer the resolution component φ_(i) and the gray components a₀ and a₁ from the registers 72, 73 and 74 to the buffer memory 15.

In the case of D₁ =1, the coding control circuit 86 applies to the timing control circuit 75 a command signal for decomposing the block and, at the same time, controls the setting circuit 85 to change its content to a preset value T₄ corresponding to the size of the block to be divided next. Until then, the picture element signals of the blocks each composed of 8×8 picture elements, as shown in FIG. 23A, have been read in, but, as depicted in FIG. 23B, the block is subdivided into four blocks 91, each composed of 4×4 picture elements, and for each block, picture element signals are read in a temporary storage and similarly coded and then decoded to obtain the decoded output y_(i), which is compared with the original picture element signal x_(i) to obtain the sum total ε₁ ², ultimately detecting whether the comparator output D₁ is "0" or "1". In this case, since the number of picture elements in each block has changed to 4×4, the timing control circuit 75 applies a divisor change command to the threshold value calculator 17 via a terminal 27, whereby to change the set value of the divisor register 25 in FIG. 4 from 8×8 to 4×4. In the event that the comparator output D₁ is 0 as a result of coding of the block 91 composed of 4×4 picture elements, the coded output of the comparator output is sent out; in the case of the comparator output D₁ being 1, the block 91 is further subdivided into four blocks 92, each composed of 2×2 picture elements, as shown in FIG. 23C, and for each block 92, similar coding processing takes place to send out the coded output. In the block control circuit 71 of FIG. 22, coded block size information representative of the block size is set in a status register 93 from the coding control circuit 86, and when to send out the coded output to the buffer memory 15, if the block size is changed, information indicative of the new size is written in the buffer memory 15 via a terminal 94.

For decoding the coded signal that the block size is controlled, the information representative of the block size is extracted from received information and, based on the extracted information, an address is produced to effect the same decoding as shown in FIG. 7.

In FIG. 24 there is shown a flowchart for programmatically achieving the picture element coding while controlling the block size. In a step S₁₀₂ the content N of the block row memory is set to 1, and in a step S₁₀₃ the content M of the block column memory is set to 1. In a step S₁₀₄ the block composed of 8×8 picture elements is read in a temporary storage, and in a step S₁₀₅ the components a₀, a₁ and φ_(ij) are calculated for the block. The total sum ε₁ ² of the squares of the error is calculated from the components a₀, a₁ and φ_(ij) in a step S₁₀₆ and compared with the preset value T₈ in a step S₁₀₇. Where ε₁ ² ≦T₈, the components a₀, a₁ and φ_(ij) are sent out in the step S₁₀₆ ', and in a step S₁₀₇ ' the content M of the block column memory is added with 1, and then the content M is checked in a step S₁₀₈. If M≦Mm, the operation goes back to the step S₁₀₄, whereas if M>Mm the content N of the block row memory is added with 1. The content N is checked in a step S₁₁₀, and where N≦Mn, the operation goes back to the step S₁₀₃, but when N>Nm, the operation comes to an end.

In the case of ε₁ ² >T₈ in the step S₁₀₇, the content L of a medium block row memory is set to 1 in a step S₁₁₁, and in the step S₁₁₂ the content K of a medium block column memory is set to 1. In a step S₁₁₃ picture element signals of a medium block designated by L=1 and K=1 in the large block (M,N). In a step S₁₁₄ the components a₀, a₁ and φ_(ij) are calculated for the medium block, and in a step S₁₁₅ the aforesaid total sum ε₁ ² is calculated based on the components a₀, a₁ and φ_(ij). The sum total ε₁ ² thus obtained is compared with the preset value T₄ in a step S₁₁₆, and if ε₁ ² ≦T₄, the components a₀, a₁ and φ_(ij) are sent out in a step S₁₁₇ and the content K of the medium block column memory is added with 1 in a step S₁₁₈, and the content K is checked in a step S₁₁₉. Where K≦2, the operation goes back to the step S₁₁₃, whereas when K>2 the content L of the medium block row memory is added with 1 in a step S₁₂₀. Then, the content L is checked in a step S₁₂₁, and if L≦2, the operation goes back to the step S₁₁₂ and if L>2, the operation goes to the step S_(107').

Where ε₁ ² >T₄ in the step S₁₁₆, the operation proceeds to a step S₁₂₂, in which the content Q of a small block row memory is set to 1, and in a step S₁₂₃ the content P of a small block column memory is set to 1. In a step S₁₂₄ picture signals of a small block designated by P=1 and Q=1 in the medium block (K,L) included in the large block (M,N), are read in a temporary storage. From the picture elements the components a₀, a₁ and φ_(ij) are calculated in a step S₁₂₅ and sent out in a step S₁₂₆. In a step S₁₂₇ the content P of the small block column memory is added with 1, and then the content P is checked in a step S₁₂₈. In this case, if P≦2, the operation goes back to the step S₁₂₄, and if P>2, the operation proceeds to a step S₁₂₉, in which the content Q of the small block row memory is added with 1. The content Q is checked in a step S₁₃₀, and if Q≦2, the operation goes back to the step S₁₂₃, and if Q>2, the operation goes to a step S₁₁₈.

In FIG. 25 there is shown a flowchart for decoding the signal coded, with the block size controlled. The decoding operation starts with a step S₁₃₁ in which the components a₀, a₁ and φ_(ij) of one block of the size corresponding to the block size information is read in a temporary storage, and in the next step S₁₃₂ it is checked whether or not the block size information is 8×8. In the case of YES, the read-in block is decoded in a step S₁₃₃, and in a step S₁₃₄ it is checked whether decoding of one frame has been completed or not. If not, the components a₀, a₁ and φ_(ij) of the next block composed of 8×8 picture elements are read in the temporary storage in a step S₁₃₅, and then the operation goes back to the step S₁₃₂. In the step S₁₃₂, if the block size is not 8×8, the operation goes to a step S₁₃₆ to check whether the block size information is 4×4 or not. In the case of YES, the block of the size 4×4 is decoded in a step S₁₃₇, and then in a step S₁₃₈ it is checked whether decoding of the four (4×4)-picture-element block has been finished or not. If not, the components a₀, a₁ and φ_(ij) of the next (4×4)-picture-element block are read in the temporary storage, and upon completion of successive decoding of the four (4×4)-picture-element blocks in the step S₁₃₈, the operation goes back to the step S₁₃₄. In the case of NO in the step S₁₃₆, the operation goes to a step S₁₄₀ to effect decoding of the (2×2)-picture-element block. In a step S₁₄₁ it is checked whether four (2×2)-picture-element blocks have been decoded in succession or not. If not, the operation goes back to the step S₁₄₀, but if such decoding has been completed, the operation goes back to the step S₁₃₈.

As has been described in the foregoing, according to the picture signal coding apparatus of this invention, the picture frame is divided into a plurality of blocks and, for each block, at least two gray components and resolution components for each picture element are obtained, so that the minuteness and the tone wedge property of the picture are not impaired, and in addition, since a plurality of bits are not coded for each picture element, the number of bits used is small as a whole and the coding can be made highly efficient. Further, since the coding can be achieved by addition for each picture element or division for each block, the coding can be easily executed by a stored program, using a microprocessor, and the structure therefor can be made relatively simple as compared with that formed as a wired logic. As the resolution component is a binary signal and corresponds to each picture element, coding errors do not markedly degrade the picture quality. Decoding is achieved by controlling a gate circuit with the resolution component and the structure therefor can be formed easily.

Further, it is possible to avoid centering of the conversion errors on the border of the block by using, for each coding block, the threshold value of the reference block which overlaps and is larger than the coding block, or by correcting the threshold value in the vicinity of the border of the block with the threshold value of the adjoining block and dividing the picture frame into first and second block groups overlapping but displaced from each other to classify adjacent ones of the picture elements into the different block groups. Also, it is possible to make the blocks unnoticed in the reconstructed picture by forming the border line between adjacent ones of the blocks zigzag, though not described in the foregoing embodiment of the instant invention.

The coding efficiency can be further enhanced by changing the block size in accordance with the property of the picture in its particular portion.

In the foregoing, the blocks are each described to be square but may also be of a triangular, rhombic or like configuration. Moreover, the foregoing embodiment uses one threshold value and two typical luminance levels a₀ and a₁, but a plurality of threshold values may also be employed. In such a case, the picture element signals of one block are each classified into any one of a plurality of level ranges defined by the plurality of threshold values to obtain the resolution component φ_(i). Consequently, this resolution component φ_(i) is represented by a plurality of bits. From this resolution component φ_(i), each picture element signal and the threshold values, the typical luminance levels are calculated in the respective level ranges. In the foregoing embodiment, the mean value x of the picture element signals of each block is used as the threshold value x_(t) and the typical luminance levels a₀ and a₁ are determined so that the sum total ε₁ ² of the squares of the conversion errors x_(i) -y_(i) in one block may be minimized in respect of the typical luminance levels a₀ and a₁ and that the mean values x and y of the picture element signals before and after the conversion may be equal to each other. However, it is also possible to determine the threshold value x_(t) and the typical luminance levels a₀ and a₁ by the variance method or the variable threshold method, as referred to previously. In the foregoing embodiment, it is checked in the case of controlling the block size, whether or not the sum total ε₁ ² of the squares of the errors ε_(i) of each picture element before and after conversion exceeds a preset value, but it is also possible to determine whether to change the block size based on the result of checking whether or not the sum total of absolute values of the errors ε_(i). Moreover, in the foregoing embodiment, a large block is changed to smaller ones, but it is also possible to change a small block to larger ones. The number of block sizes used in the foregoing is three but is not limited specifically thereto. The preset values T₈ and T₄ for determining whether to change the block size may also be fixed irrespective of the block size. Further, in the foregoing embodiment, when the block size is changed, larger and smaller blocks are made similar in configuration to each other, but the smaller block may also be one that its size is increased only in its lateral or vertical direction. At any rate, it is preferred that the size of the larger block is an odd multiple of the smaller block. Moreover, for a block of a slight luminance change, it is also possible to output only the mean value of the typical brightness levels a₀ and a₁, that is, only one typical gray level, instead of outputting the both typical luminance levels. The eyes do not sharply discriminate absolute brightness at a place of a large brightness change. In view of this, the number of bits quantizing the typical gray level may be reduced for a block of a large luminance level change. This will further reduce the number of bits used. Although this invention is suitable for the coding of still pictures, the invention is also applicable to the coding of moving pictures by effecting coding at a sufficiently high speed as compared with the speed of the moving picture.

It will be apparent that many modifications and variations may be effected without departing from the scope of the novel concepts of this invention. 

What is claimed is:
 1. A picture signal coding apparatus comprising:threshold value setting means for setting at least one threshold value for each of a plurality of coding blocks into which a frame of a gray-scaled picture is divided, based on the luminance distribution in each block; means for classifying the luminance level of each picture element of each coding block into any one of level ranges defined by the threshold value to obtain a resolution component; typical luminance level calculating means for obtaining at least two typical luminance levels from the classification result and the brightness levels of the picture elements of each coding block; decoding means for decoding the picture elements of each coding block based on the resolution component and the threshold value; error calculating means for a calculating a coding error in the coding of the coding block from each decoded picture element and its original picture element; block size changing means for comparing the calculated error with a set value to change the size of each coding block in accordance with the compared output; and means for providing, as true coded outputs, the resolution component and the typical luminance levels when the error is in a predetermined range.
 2. A picture signal coding apparatus according to claim 1, wherein said block size changing means changes the size of the coding block to a smaller size when the error is larger than the set value.
 3. A picture signal coding apparatus according to claim 1, wherein two coding blocks before and after conversion are selected so that the size of one of the two blocks is an integral multiple of the size of the other.
 4. A picture signal coding apparatus according to claim 2, wherein the resolution component is composed of one bit for each picture element, wherein the number of typical luminance levels used is two, and wherein said decoding means outputs one of the two typical brightness levels with one of logical values of the resolution component and the other typical brightness level with the other logical value.
 5. A picture signal coding apparatus according to claim 1, wherein said threshold value setting means sets the threshold value based on the luminance distribution of a reference block including said each coding block and larger than it.
 6. A picture signal coding apparatus according to claim 1, which further includes threshold value correcting means for selecting the threshold value for picture elements near the border of said each coding block to be intermediate between the threshold value and that of the adjoining block.
 7. A picture signal coding apparatus according to claim 1, wherein the frame is further divided into other coding blocks respectively displaced from the coding blocks to make one of adjacent ones of the picture elements belong to one of the coding blocks and the other belong to one of the other coding blocks, and wherein the both coding blocks are coded independently of each other.
 8. A picture signal coding apparatus according to claim 1, wherein said threshold value setting means sets one threshold value, wherein the resolution component is information composed of one bit for each picture element, and wherein the number of typical brightness levels used is two.
 9. A picture signal coding apparatus according to claim 9, wherein said threshold value setting means obtains a mean value of the luminance levels of the picture elements of each block, and wherein said typical luminance level calculating means calculate mean values a₀ and a₁ of the luminance levels of the picture elements below and above the threshold value.
 10. A picture signal coding apparatus according to claim 1, wherein said threshold value setting means, said resolution component obtaining means and said typical luminance level calculating means are formed with a common microprocessor. 